﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Genghis;

namespace NiagaraDataServiceUtil
{
  [CommandLineParser.ParserUsage("Command-line utility to generate client proxy for ADO.NET Data Services with \r\nsupport for generation of validation information", 
    AllowArgumentFile=false, 
    ShowCategories=true)]
  internal class GeneratorCommandLine : CommandLineParser
  {

    [CommandLineParser.ValueUsage("URI to the Data Service Endpoint", 
      Optional = false, 
      MatchPosition=true, 
      Category="General")]
    public string DSAddress = null;

    [CommandLineParser.ValueUsage("Path to the assembly with the original types", 
      Optional = false, 
      MatchPosition = true, 
      Category="General")]
    public string EntityAssembly = null;

    [CommandLineParser.ValueUsage("Path to the file to create.", 
      Optional = false, 
      MatchPosition=true, 
      Category="General")]
    public string OutputPath = "";

    [CommandLineParser.ValueUsage("The Namespace for the generated code.", 
      Optional = false, 
      MatchPosition=true, 
      Category="General")]
    public string Namespace = "";

    [CommandLineParser.FlagUsage("Should Generate Validation Code", Name = "v", Category = "CodeGen", AllowOnOff = false)]
    public bool GenerateValidationCode = false;

    [CommandLineParser.FlagUsage("Should Generate Binding Code", Name = "b", Category = "CodeGen", AllowOnOff = false)]
    public bool GenerateBindingCode = false;

    [CommandLineParser.ValueUsage("Language to generate (CS or VB)", Name = "l", LegalValues="(CS|VB)", Category="CodeGen")]
    public string Language = "CS";

    [CommandLineParser.ValueUsage("Client Code to generate (V1 or V2)", Name = "c", LegalValues = "(V1|V2)", Category = "CodeGen")]
    public string Version = "V1";

    public override string GetLogo()
    {
      string logo = base.GetLogo();

      return string.Concat(logo, Environment.NewLine, "Portions Copyright © 2002-2007 The Genghis Group (http://www.genghisgroup.com/).");
    }


  }
}
